home *** CD-ROM | disk | FTP | other *** search
/ Workbench Add-On / Workbench Add-On - Volume 1.iso / BBS-Archive / Dev / gcc263-src.lha / gcc-2.6.3 / config / lynx.h < prev    next >
C/C++ Source or Header  |  1994-10-04  |  5KB  |  174 lines

  1. /* Target independent definitions for LynxOS.
  2.    Copyright (C) 1993, 1994 Free Software Foundation, Inc.
  3.  
  4. This file is part of GNU CC.
  5.  
  6. GNU CC is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2, or (at your option)
  9. any later version.
  10.  
  11. GNU CC is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with GNU CC; see the file COPYING.  If not, write to
  18. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  19.  
  20. /* LynxOS is a multi-platform Unix, similar to SVR3, but not identical.
  21.    We can get quite a bit from generic svr3, but have to do some overrides. */
  22.  
  23. #include "svr3.h"
  24.  
  25. /* Define various macros, depending on the combination of flags. */
  26.  
  27. #undef CPP_SPEC
  28. #define CPP_SPEC "%{mthreads:-D_MULTITHREADED}  \
  29.   %{mposix:-D_POSIX_SOURCE}  \
  30.   %{msystem-v:-I/usr/include_v}"
  31.  
  32. /* No asm spec needed, since using GNU assembler always. */
  33.  
  34. /* No linker spec needed, since using GNU linker always. */
  35.  
  36. #undef LIB_SPEC
  37. #define LIB_SPEC "%{mthreads:-L/lib/thread/}  \
  38.   %{msystem-v:-lc_v}  \
  39.   %{!msystem-v:%{mposix:-lc_p} -lc}"
  40.  
  41. /* Set the appropriate names for the Lynx startfiles. */
  42.  
  43. #undef STARTFILE_SPEC
  44. #define STARTFILE_SPEC "%{p:pinit1.o%s}%{!p:%{msystem-v:vinit1.o%s}%{!msystem-v:init1.o%s}}"
  45.  
  46. #undef ENDFILE_SPEC
  47. #define ENDFILE_SPEC "%{p:_etext.o%s}%{!p:initn.o%s}"
  48.  
  49. /* Override the svr3 versions. */
  50.  
  51. #undef WCHAR_TYPE
  52. #define WCHAR_TYPE "int"
  53.  
  54. #undef PTRDIFF_TYPE
  55. #define PTRDIFF_TYPE "long int"
  56.  
  57. /* We want to output DBX (stabs) debugging information normally.  */
  58.  
  59. #define DBX_DEBUGGING_INFO
  60. #undef PREFERRED_DEBUGGING_TYPE
  61. #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
  62.  
  63. /* It is convenient to be able to generate standard coff debugging
  64.    if requested via -gcoff. */
  65.  
  66. #define SDB_DEBUGGING_INFO
  67.  
  68. /* Be function-relative for block and source line stab directives. */
  69.  
  70. #define DBX_BLOCKS_FUNCTION_RELATIVE 1
  71.  
  72. /* but, to make this work, functions must appear prior to line info */
  73.  
  74. #define DBX_FUNCTION_FIRST
  75.  
  76. /* Generate a blank trailing N_SO to mark the end of the .o file, since
  77.    we can't depend upon the linker to mark .o file boundaries with
  78.    embedded stabs.  */
  79.  
  80. #define DBX_OUTPUT_MAIN_SOURCE_FILE_END(FILE, FILENAME)            \
  81.   fprintf (FILE,                            \
  82.        "\t.text\n\t.stabs \"\",%d,0,0,Letext\nLetext:\n", N_SO)
  83.  
  84. #undef  ASM_OUTPUT_SOURCE_LINE
  85. #define ASM_OUTPUT_SOURCE_LINE(file, line)        \
  86.   { static int sym_lineno = 1;                \
  87.     fprintf (file, ".stabn 68,0,%d,.LM%d-",        \
  88.          line, sym_lineno);                \
  89.     assemble_name (file,                \
  90.            XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0)); \
  91.     fprintf (file, "\n.LM%d:\n", sym_lineno);        \
  92.     sym_lineno += 1; }
  93.  
  94. /* Handle #pragma pack and sometimes #pragma weak.  */
  95.  
  96. #define HANDLE_SYSV_PRAGMA
  97.  
  98. /* Some additional command-line options. */
  99.  
  100. #define TARGET_THREADS    (target_flags & MASK_THREADS)
  101. #define MASK_THREADS    0x40000000
  102.  
  103. #define TARGET_POSIX    (target_flags & MASK_POSIX)
  104. #define MASK_POSIX    0x20000000
  105.  
  106. #define TARGET_SYSTEM_V    (target_flags & MASK_SYSTEM_V)
  107. #define MASK_SYSTEM_V    0x10000000
  108.  
  109. #undef SUBTARGET_SWITCHES
  110. #define SUBTARGET_SWITCHES \
  111.     {"threads",        MASK_THREADS},        \
  112.     {"posix",        MASK_POSIX},        \
  113.     {"system-v",    MASK_SYSTEM_V},
  114.  
  115. #undef SUBTARGET_OVERRIDE_OPTIONS
  116. #define SUBTARGET_OVERRIDE_OPTIONS \
  117. { if (TARGET_SYSTEM_V && profile_flag)            \
  118.     warning ("-msystem-v and -p are incompatible");        \
  119.   if (TARGET_SYSTEM_V && TARGET_THREADS)            \
  120.     warning ("-msystem-v and -mthreads are incompatible"); }
  121.  
  122. /* Define this so that C++ destructors will use atexit, since LynxOS
  123.    calls exit after main returns.  */
  124.  
  125. #define HAVE_ATEXIT
  126.  
  127. /* Since init.o et al put all sorts of stuff into the init section,
  128.    we can't use the standard init section support in crtbegin.o. */
  129.  
  130. #undef INIT_SECTION_ASM_OP
  131.  
  132. #undef EXTRA_SECTIONS
  133. #define EXTRA_SECTIONS in_const, in_bss, in_ctors, in_dtors, in_fini,
  134.  
  135. #undef EXTRA_SECTION_FUNCTIONS
  136. #define EXTRA_SECTION_FUNCTIONS                    \
  137.   CONST_SECTION_FUNCTION                    \
  138.   BSS_SECTION_FUNCTION                        \
  139.   CTORS_SECTION_FUNCTION                    \
  140.   DTORS_SECTION_FUNCTION                    \
  141.   FINI_SECTION_FUNCTION
  142.  
  143. #undef CTORS_SECTION_ASM_OP
  144. #define CTORS_SECTION_ASM_OP    ".section\t.ctors"
  145. #undef DTORS_SECTION_ASM_OP
  146. #define DTORS_SECTION_ASM_OP    ".section\t.dtors"
  147.  
  148. #define INT_ASM_OP        ".long"
  149.  
  150. /* A C statement (sans semicolon) to output an element in the table of
  151.    global constructors.  */
  152. #undef ASM_OUTPUT_CONSTRUCTOR
  153. #define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME)                \
  154.   do {                                    \
  155.     ctors_section ();                            \
  156.     fprintf (FILE, "\t%s\t ", INT_ASM_OP);                \
  157.     assemble_name (FILE, NAME);                        \
  158.     fprintf (FILE, "\n");                        \
  159.   } while (0)
  160.  
  161. /* A C statement (sans semicolon) to output an element in the table of
  162.    global destructors.  */
  163. #undef ASM_OUTPUT_DESTRUCTOR
  164. #define ASM_OUTPUT_DESTRUCTOR(FILE,NAME)                       \
  165.   do {                                    \
  166.     dtors_section ();                                   \
  167.     fprintf (FILE, "\t%s\t ", INT_ASM_OP);                \
  168.     assemble_name (FILE, NAME);                              \
  169.     fprintf (FILE, "\n");                        \
  170.   } while (0)
  171.  
  172. #undef DO_GLOBAL_CTORS_BODY
  173. #undef DO_GLOBAL_DTORS_BODY
  174.